<template>
  <view class='star-rating'>
    <block v-for="i in [1,2,3,4,5]" :key="i">
      <image src="/static/star01.png" v-if="i <= count"></image>
      <image src="/static/star02.png" v-if="i > count && i - 1 < count"></image>
      <image src="/static/star03.png" v-if="i > count && !(i - 1 < count)"></image>
    </block>
  </view>
</template>

<script>
	export default {
		name:"star",
		props:{
			count: {
				type: Number,
				default: 0
			},
		},
		data() {
			return {
				
			};
		}
	}
</script>

<style>
.star-rating {
    display: inline-block;
    margin-right: 6rpx;
    flex: 1;
}
.star-rating image {
    width: 28rpx;
    height: 27rpx;
    margin-right: 4rpx;
}
</style>
